home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
add_cs
/
add_cs.doc
< prev
Wrap
Text File
|
1987-07-31
|
3KB
|
69 lines
Note: This file MUST accompany add_cs.c.
This archive contains the following files:
add_cs.c
add_cs.doc
If you use the TurboC TCC C compiler, you have probably noticed the
-S option which allows you compile a C source file into its
'equivalent' assembly language source program. Interspersed in this
assembly language file are comments which indicate which lines in the
original C source file are being processed. This program replaces
the line numbers with the actual C source statements to which they
correspond. The result is an assembly language listing with C source
statements placed to indicate the assembly code being generated for
the particular C code sequence. Such a listing is useful for
learning assembly language programming, evaluating code generation
efficiency and other applications.
Rather than providing you with an executable module, I am releasing
the source code. Since no two programmers want the same features,
you can customize the program so that you 'can have it your way.'
The only thing that I ask is that it NOT be used for commercial
ventures of ANY kind. No amount of modification and/or rewrite of
the source code will allow you to consider the resultant source code
to be your property.
Compile this program using using TurboC. Although it should make no
difference, consider compiling it with the small model.
Using the program is quite easy. You must have a C source file and
an assembly language source listing of the compiled C source file
(generated using TCC). By executing add_cs.exe with NO command line
arguments, you will receive instructions on how to use the program.
To use the program, type
add_cs xx.c xx.asm xx.asc
at the DOS command prompt (or use a batch file if you wish to
automate the process). xx.c is the name of the C source file that
was compiled to an .asm file using TCC. xx.asm is the name of the
assembly language file generated from xx.c by TCC. xx.asc is the new
file which contains the assembly language program mixed with the C
source inserted as comments. You MUST include the extensions with
the filenames.
If any of the input files (xx.c, xx.asm) cannot be opened, the
program aborts with the appropriate message. If the output file
(xx.asc) cannot be opened or if it already exists, the program aborts
with the appropriate message. If the C source file (xx.c) empties
prematurely, an appropriate message is issued and the destination
file (xx.asc) is deleted from the directory. During operation, the
program prints a period (.) for each comment (comments indicate line
number in the C source file) in the assembly language file that is
processed. The original input files are NOT modified in any way.
Enjoy!
Eugene J. Alm
12145 West Luther Court
Hales Corners, Wisconsin, 53130
Copyright 1987 by Eugene J. Alm. All rights reserved.